package com.yao.longhan.presenter;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.android.volley.toolbox.ImageLoader;
import com.yao.longhan.BaseApplication;
import com.yao.longhan.listener.ItemClickListener;

import butterknife.ButterKnife;

/**
 * Created by heyao on 2017/7/31.
 */

public abstract class BaseHolder<T> extends RecyclerView.ViewHolder {

    protected String TAG = getClass().getSimpleName();
    protected ImageLoader mImageLoader;
    protected ItemClickListener mClickListener;

    public BaseHolder(View itemView) {
        this(itemView, null);
    }

    public BaseHolder(View itemView, BaseApplication application) {
        super(itemView);
        ButterKnife.bind(this, itemView);
        mImageLoader = application == null ? null : application.getImageLoader();
    }

    public abstract void bindData(int position, T t);

    public void setClickListener(ItemClickListener clickListener) {
        this.mClickListener = clickListener;
    }
}
